﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace HengTong.DataAccess.Migrations
{
    /// <inheritdoc />
    public partial class 增加人员入职关联录用候选池id : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AlterColumn<string>(
                name: "StaffNo",
                table: "SysPerson",
                type: "nvarchar(128)",
                maxLength: 128,
                nullable: true,
                oldClrType: typeof(string),
                oldType: "nvarchar(128)",
                oldMaxLength: 128);

            migrationBuilder.AddColumn<Guid>(
                name: "InterviewPoolId",
                table: "SysPerson",
                type: "uniqueidentifier",
                nullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_SysPerson_InterviewPoolId",
                table: "SysPerson",
                column: "InterviewPoolId");

            migrationBuilder.AddForeignKey(
                name: "FK_SysPerson_SysHrInterviewPool_InterviewPoolId",
                table: "SysPerson",
                column: "InterviewPoolId",
                principalTable: "SysHrInterviewPool",
                principalColumn: "ID");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropForeignKey(
                name: "FK_SysPerson_SysHrInterviewPool_InterviewPoolId",
                table: "SysPerson");

            migrationBuilder.DropIndex(
                name: "IX_SysPerson_InterviewPoolId",
                table: "SysPerson");

            migrationBuilder.DropColumn(
                name: "InterviewPoolId",
                table: "SysPerson");

            migrationBuilder.AlterColumn<string>(
                name: "StaffNo",
                table: "SysPerson",
                type: "nvarchar(128)",
                maxLength: 128,
                nullable: false,
                defaultValue: "",
                oldClrType: typeof(string),
                oldType: "nvarchar(128)",
                oldMaxLength: 128,
                oldNullable: true);
        }
    }
}
